package com.wy.io;
import java.io.*;
/**
 * @author 美女
 * @date 2022/05/09 20:26
 **/
public class WriteText {
    public static void main(String[] args) throws IOException {
        try(OutputStream os=new FileOutputStream("../world2.txt")){
            try(Writer writer=new OutputStreamWriter(os,"UTF-8")){
                try(PrintWriter printWriter=new PrintWriter(writer)){
                    printWriter.println("你好世界");
                    printWriter.print("中国");
                    printWriter.printf("%s,%d\r\n","走起来",123);
                    printWriter.flush();
                }
            }
        }
    }
}
